<template>
	<view>
		<top :name="studentSelf.name"></top>
		<student :student="studentSelf" :score="score"></student>
	</view>
</template>

<script>
	import top from "../top/top"
	import student from "./student"
	export default {
		components:{
			top,student
		},
		data() {
			return {
				studentSelf:{},
				score:{}
			}
		},
		methods: {
			
		},
		onLoad(options) {
			uni.request({
			    url: 'http://localhost:8080/user/getUser/'+options.id, //仅为示例，并非真实接口地址。
			    success: (res) => {
			        this.studentSelf = res.data
			        
			    }
			});
			uni.request({
			    url: 'http://localhost:8080/user//getScore/'+options.id, //仅为示例，并非真实接口地址。
			    success: (res) => {
					console.log(res.data)
					if(res.data[0] == null) {
						console.log("aaa")
						 this.score = [{
							 kaoName:"暂无考试数据",
							 score:"暂无考试数据"
						 }]
					}else{
						this.score = res.data
					}
					
			       
			    }
			});
		}
	}
</script>

<style>

</style>
